package me.joshua.demo4j.spring.groovy.performance.service;

import me.joshua.demo4j.spring.groovy.performance.model.Member;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author <a href="mailto:daonan.zhan@gmail.com">Joshua Zhan</a>
 */
@Service("javaImpl")
public class ScriptServiceJavaImpl implements ScriptService {

	@Autowired
	public MemberService memberService;

	@Override
	public void queryMember() {
	}

	@Override
	public Member queryMember(String name, String email) {
		Member member = memberService.findMember(email);
		if (name.equals(member.getName())) {
			return member;
		} else {
			return null;
		}
	}

	@Override
	public Member queryMemger(String name, String email, int id, int[] ids,
			String[] emails, String... names) {
		Member member = memberService.findMember(email);
		if (name.equals(member.getName())) {
			return member;
		} else {
			return null;
		}
	}

}
